package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 商品品牌
 * </p>
 *
 * @author cnswhy
 * @since 2020-10-22
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_shop_brand")
@ApiModel(value = "ShopBrand", description = "商品品牌")
@AllArgsConstructor
public class ShopBrand extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 品牌名称
     */
    @ApiModelProperty(value = "品牌名称")
    @NotEmpty(message = "品牌名称不能为空")
    @Length(max = 50, message = "品牌名称长度不能超过50")
    @TableField(value = "brand_name", condition = LIKE)
    @Excel(name = "品牌名称")
    private String brandName;

    /**
     * 品牌logo
     */
    @ApiModelProperty(value = "品牌logo")
    @Length(max = 255, message = "品牌logo长度不能超过255")
    @TableField(value = "brand_img", condition = LIKE)
    @Excel(name = "品牌logo")
    private String brandImg;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    @TableField("sort_order")
    @Excel(name = "排序")
    private Integer sortOrder;

    /**
     * 1正常2删除3待审核4审核不通过
     */
    @ApiModelProperty(value = "1正常2删除3待审核4审核不通过")
    @TableField("status")
    @Excel(name = "1正常2删除3待审核4审核不通过")
    private Integer status;

    @ApiModelProperty(value = "")
    @TableField("merchant_id")
    @Excel(name = "")
    private Long merchantId;

    /**
     * 品牌描述
     */
    @ApiModelProperty(value = "品牌描述")
    @Length(max = 255, message = "品牌描述长度不能超过255")
    @TableField(value = "brand_desc", condition = LIKE)
    @Excel(name = "品牌描述")
    private String brandDesc;

    /**
     * 拒绝原因
     */
    @ApiModelProperty(value = "拒绝原因")
    @Length(max = 255, message = "拒绝原因长度不能超过255")
    @TableField(value = "remark", condition = LIKE)
    @Excel(name = "拒绝原因")
    private String remark;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "url", condition = LIKE)
    @Excel(name = "")
    private String url;


    @Builder
    public ShopBrand(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser, 
                    String brandName, String brandImg, Integer sortOrder, Integer status, Long merchantId, 
                    String brandDesc, String remark, String url) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.brandName = brandName;
        this.brandImg = brandImg;
        this.sortOrder = sortOrder;
        this.status = status;
        this.merchantId = merchantId;
        this.brandDesc = brandDesc;
        this.remark = remark;
        this.url = url;
    }

}
